package com.osmino.contacts.groups;

import com.osmino.core.utils.Print;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;

public class MRelativeLayout extends RelativeLayout{
	
	private OnTouchListener mListener = new OnTouchListener() {
		@Override
		public boolean onTouch(View v, MotionEvent event) {
			return false;
		}
	};
	
	public MRelativeLayout(Context context, int layout) {
		super(context);
		LayoutInflater.from(context).inflate(layout, this);
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		super.onTouchEvent(event);
		return true;
	}
	
	public boolean onInterceptTouchEvent (MotionEvent ev){
		mListener.onTouch(null, ev);
		return false;
	}
	
	public void setInterceptTouchListener(OnTouchListener listener){
		mListener = listener;
	}
}
